package com.way.Java多线程编程核心技术v2.chapter02_对象及变量的并发访问._2_2_synchronized同步语句块.synchronized代码块间的同步性;

/**
 * @PROJECT_NAME: my-projects
 * @DESCRIPTION:
 * @USER: 魏彪
 * @DATE: 2023/11/29 11:00
 */
public class Test {
    public static void main(String[] args) {
        ObjectService objectService = new ObjectService();

        ThreadA a = new ThreadA(objectService);
        a.setName("A");
        a.start();

        ThreadB b = new ThreadB(objectService);
        b.setName("B");
        b.start();
    }
}
